home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / faq / news1114.txt < prev    next >
Text File  |  1997-01-06  |  15KB  |  278 lines

  1. Subject: Cryptography FAQ (06/10: Public Key Cryptography)
  2. Supersedes: <cryptography-faq/part06_848729385@rtfm.mit.edu>
  3. Date: 14 Dec 1996 06:51:11 GMT
  4. References: <cryptography-faq/part01_850546235@rtfm.mit.edu>
  5. X-Last-Updated: 1994/07/05
  6.  
  7.  
  8. This is the sixth of ten parts of the sci.crypt FAQ. The parts are
  9. mostly independent, but you should read the first part before the rest.
  10. We don't have the time to send out missing parts by mail, so don't ask.
  11. Notes such as ``[KAH67]'' refer to the reference list in the last part.
  12.  
  13. The sections of this FAQ are available via anonymous FTP to rtfm.mit.edu 
  14. as /pub/usenet/news.answers/cryptography-faq/part[xx]. The Cryptography 
  15. FAQ is posted to the newsgroups sci.crypt, talk.politics.crypto, 
  16. sci.answers, and news.answers every 21 days.
  17.  
  18.  
  19.  
  20. Contents:
  21.  
  22. 6.1. What is public-key cryptography?
  23. 6.2. How does public-key cryptography solve cryptography's Catch-22?
  24. 6.3. What is the role of the `trapdoor function' in public key schemes?
  25. 6.4. What is the role of the `session key' in public key schemes?
  26. 6.5. What's RSA?
  27. 6.6. Is RSA secure?
  28. 6.7. What's the difference between the RSA and Diffie-Hellman schemes?
  29. 6.8. What is `authentication' and the `key distribution problem'?
  30. 6.9. How fast can people factor numbers?
  31. 6.10. What about other public-key cryptosystems?
  32. 6.11. What is the `RSA Factoring Challenge?'
  33.  
  34.  
  35. 6.1. What is public-key cryptography?
  36.  
  37.   In a classic cryptosystem, we have encryption functions E_K and
  38.   decryption functions D_K such that D_K(E_K(P)) = P for any plaintext
  39.   P. In a public-key cryptosystem, E_K can be easily computed from some
  40.   ``public key'' X which in turn is computed from K. X is published, so
  41.   that anyone can encrypt messages. If decryption D_K cannot be easily 
  42.   computed from public key X without knowledge of private key K, but 
  43.   readily with knowledge of K, then only the person who generated K can 
  44.   decrypt messages. That's the essence of public-key cryptography, 
  45.   introduced by Diffie and Hellman in 1976. 
  46.   
  47.   This document describes only the rudiments of public key cryptography.
  48.   There is an extensive literature on security models for public-key 
  49.   cryptography, applications of public-key cryptography, other 
  50.   applications of the mathematical technology behind public-key 
  51.   cryptography, and so on; consult the references at the end for more 
  52.   refined and thorough presentations.
  53.  
  54. 6.2. How does public-key cryptography solve cryptography's Catch-22?
  55.  
  56.   In a classic cryptosystem, if you want your friends to be able to
  57.   send secret messages to you, you have to make sure nobody other than
  58.   them sees the key K. In a public-key cryptosystem, you just publish 
  59.   X, and you don't have to worry about spies. Hence public key 
  60.   cryptography `solves' one of the most vexing problems of all prior 
  61.   cryptography: the necessity of establishing a secure channel for the 
  62.   exchange of the key. To establish a secure channel one uses 
  63.   cryptography, but private key cryptography requires a secure channel! 
  64.   In resolving the dilemma, public key cryptography has been considered 
  65.   by many to be a `revolutionary technology,' representing a 
  66.   breakthrough that makes routine communication encryption practical 
  67.   and potentially ubiquitous.
  68.  
  69. 6.3. What is the role of the `trapdoor function' in public key schemes?
  70.   
  71.   Intrinsic to public key cryptography is a `trapdoor function' D_K 
  72.   with the properties that computation in one direction (encryption, 
  73.   E_K) is easy and in the other is virtually impossible (attack,
  74.   determining P from encryption E_K(P) and public key X). Furthermore, 
  75.   it has the special property that the reversal of the computation 
  76.   (decryption, D_K) is again tractable if the private key K is known.
  77.  
  78. 6.4. What is the role of the `session key' in public key schemes?
  79.  
  80.   In virtually all public key systems, the encryption and decryption 
  81.   times are very lengthy compared to other block-oriented 
  82.   algorithms such as DES for equivalent data sizes. Therefore in most
  83.   implementations of public-key systems, a temporary, random `session 
  84.   key' of much smaller length than the message is generated for each 
  85.   message and alone encrypted by the public key algorithm. The message 
  86.   is actually encrypted using a faster private key algorithm with the 
  87.   session key. At the receiver side, the session key is decrypted using 
  88.   the public-key algorithms and the recovered `plaintext' key is used 
  89.   to decrypt the message.
  90.   
  91.   The session key approach blurs the distinction between `keys' and 
  92.   `messages' -- in the scheme, the message includes the key, and the 
  93.   key itself is treated as an encryptable `message'. Under this 
  94.   dual-encryption approach, the overall cryptographic strength is 
  95.   related to the security of either the public- and private-key 
  96.   algorithms.
  97.  
  98. 6.5. What's RSA?
  99.  
  100.   RSA is a public-key cryptosystem defined by Rivest, Shamir, and
  101.   Adleman. Here's a small example. See also [FTPDQ].
  102.  
  103.   Plaintexts are positive integers up to 2^{512}. Keys are quadruples
  104.   (p,q,e,d), with p a 256-bit prime number, q a 258-bit prime number,
  105.   and d and e large numbers with (de - 1) divisible by (p-1)(q-1). We
  106.   define E_K(P) = P^e mod pq, D_K(C) = C^d mod pq. All quantities are
  107.   readily computed from classic and modern number theoretic algorithms 
  108.   (Euclid's algorithm for computing the greatest common divisor yields
  109.   an algorithm for the former, and historically newly explored
  110.   computational approaches to finding large `probable' primes, such as 
  111.   the Fermat test, provide the latter.)
  112.  
  113.   Now E_K is easily computed from the pair (pq,e)---but, as far as
  114.   anyone knows, there is no easy way to compute D_K from the pair
  115.   (pq,e). So whoever generates K can publish (pq,e). Anyone can send a
  116.   secret message to him; he is the only one who can read the messages.
  117.  
  118. 6.6. Is RSA secure?
  119.  
  120.   Nobody knows. An obvious attack on RSA is to factor pq into p and q.
  121.   See below for comments on how fast state-of-the-art factorization
  122.   algorithms run. Unfortunately nobody has the slightest idea how to
  123.   prove that factorization---or any realistic problem at all, for that
  124.   matter---is inherently slow. It is easy to formalize what we mean by
  125.   ``RSA is/isn't strong''; but, as Hendrik W. Lenstra, Jr., says,
  126.   ``Exact definitions appear to be necessary only when one wishes to
  127.   prove that algorithms with certain properties do _not_ exist, and
  128.   theoretical computer science is notoriously lacking in such negative
  129.   results.''
  130.  
  131.   Note that there may even be a `shortcut' to breaking RSA other than
  132.   factoring. It is obviously sufficient but so far not provably 
  133.   necessary. That is, the security of the system depends on two 
  134.   critical assumptions: (1) factoring is required to break the system,
  135.   and (2) factoring is `inherently computationally intractable',
  136.   or, alternatively, `factoring is hard' and `any approach that can 
  137.   be used to break the system is at least as hard as factoring'.
  138.  
  139.   Historically even professional cryptographers have made mistakes
  140.   in estimating and depending on the intractability of various 
  141.   computational problems for secure cryptographic properties. For 
  142.   example, a system called a `Knapsack cipher' was in vogue in the
  143.   literature for years until it was demonstrated that the instances
  144.   typically generated could be efficiently broken, and the whole
  145.   area of research fell out of favor.
  146.  
  147. 6.7. What's the difference between the RSA and Diffie-Hellman schemes?
  148.  
  149.   Diffie and Hellman proposed a system that requires the dynamic 
  150.   exchange of keys for every sender-receiver pair (and in practice, 
  151.   usually every communications session, hence the term `session key').  
  152.   This two-way key negotiation is useful in further complicating 
  153.   attacks, but requires additional communications overhead. The RSA 
  154.   system reduces communications overhead with the ability to have 
  155.   static, unchanging keys for each receiver that are `advertised' by 
  156.   a formal `trusted authority' (the hierarchical model) or distributed 
  157.   in an informal `web of trust'.
  158.  
  159. 6.8. What is `authentication' and the `key-exchange problem'?
  160.  
  161.   The ``key exchange problem'' involves (1) ensuring that keys are
  162.   exchanged so that the sender and receiver can perform encryption and
  163.   decryption, and (2) doing so in such a way that ensures an
  164.   eavesdropper or outside party cannot break the code. `Authentication'
  165.   adds the requirement that (3) there is some assurance to the receiver
  166.   that a message was encrypted by `a given entity' and not `someone 
  167.   else'.
  168.  
  169.   The simplest but least available method to ensure all constraints 
  170.   above are satisfied (successful key exchange and valid authentication)
  171.   is employed by private key cryptography: exchanging the key secretly.
  172.   Note that under this scheme, the problem of authentication is 
  173.   implicitly resolved. The assumption under the scheme is that only the
  174.   sender will have the key capable of encrypting sensible messages
  175.   delivered to the receiver. 
  176.  
  177.   While public-key cryptographic methods solve a critical aspect of the 
  178.   `key-exchange problem', specifically their resistance to analysis
  179.   even with the presence a passive eavesdropper during exchange of keys, 
  180.   they do not solve all problems associated with key exchange. In
  181.   particular, since the keys are considered `public knowledge,'
  182.   (particularly with RSA) some other mechanism must be
  183.   developed to testify to authenticity, because possession of keys 
  184.   alone (sufficient to encrypt intelligible messages) is no evidence
  185.   of a particular unique identity of the sender.
  186.  
  187.   One solution is to develop a key distribution mechanism that assures
  188.   that listed keys are actually those of the given entities, sometimes
  189.   called a `trusted authority'. The authority typically does not actually
  190.   generate keys, but does ensure via some mechanism that the lists of 
  191.   keys and associated identities kept and advertised for reference
  192.   by senders and receivers are `correct'. Another method relies on users
  193.   to distribute and track each other's keys and trust in an informal,
  194.   distributed fashion. This has been popularized as a viable alternative
  195.   by the PGP software which calls the model the `web of trust'.
  196.  
  197.   Under RSA, if a person wishes to send evidence of their identity in
  198.   addition to an encrypted message, they simply encrypt some information
  199.   with their private key called the `signature', additionally included in
  200.   the message sent under the public-key encryption to the receiver. 
  201.   The receiver can use the RSA algorithm `in reverse' to verify that the
  202.   information decrypts sensibly, such that only the given entity could
  203.   have encrypted the plaintext by use of the secret key. Typically the
  204.   encrypted `signature' is a `message digest' that comprises a unique
  205.   mathematical `summary' of the secret message (if the signature were
  206.   static across multiple messages, once known previous receivers could 
  207.   use it falsely). In this way, theoretically only the sender of the
  208.   message could generate their valid signature for that message, thereby
  209.   authenticating it for the receiver. `Digital signatures' have many 
  210.   other design properties as described in Section 7.
  211.  
  212.  
  213. 6.9. How fast can people factor numbers?
  214.  
  215.   It depends on the size of the numbers, and their form. Numbers
  216.   in special forms, such as a^n - b for `small' b, are more readily
  217.   factored through specialized techniques and not necessarily related
  218.   to the difficulty of factoring in general. Hence a specific factoring 
  219.   `breakthrough' for a special number form may have no practical value 
  220.   or relevance to particular instances (and those generated for use
  221.   in cryptographic systems are specifically `filtered' to resist such
  222.   approaches.) The most important observation about factoring is that
  223.   all known algorithms require an exponential amount of time in the
  224.   _size_ of the number (measured in bits, log2(n) where `n' is the 
  225.   number). Cryptgraphic algorithms built on the difficulty of factoring
  226.   generally depend on this exponential-time property. (The distinction
  227.   of `exponential' vs. `polynomial time' algorithms, or NP vs. P, is a 
  228.   major area of active computational research, with insights very 
  229.   closely intertwined with cryptographic security.)
  230.   
  231.   In October 1992 Arjen Lenstra and Dan Bernstein factored 2^523 - 1 
  232.   into primes, using about three weeks of MasPar time. (The MasPar is 
  233.   a 16384-processor SIMD machine; each processor can add about 200000 
  234.   integers per second.) The algorithm there is called the ``number field 
  235.   sieve''; it is quite a bit faster for special numbers like 2^523 - 1 
  236.   than for general numbers n, but it takes time only 
  237.   exp(O(log^{1/3} n log^{2/3} log n)) in any case.
  238.  
  239.   An older and more popular method for smaller numbers is the ``multiple
  240.   polynomial quadratic sieve'', which takes time exp(O(log^{1/2} n
  241.   log^{1/2} log n))---faster than the number field sieve for small n,
  242.   but slower for large n. The breakeven point is somewhere between 100
  243.   and 150 digits, depending on the implementations.
  244.  
  245.   Factorization is a fast-moving field---the state of the art just a few
  246.   years ago was nowhere near as good as it is now. If no new methods are
  247.   developed, then 2048-bit RSA keys will always be safe from
  248.   factorization, but one can't predict the future. (Before the number
  249.   field sieve was found, many people conjectured that the quadratic
  250.   sieve was asymptotically as fast as any factoring method could be.)
  251.  
  252. 6.10. What about other public-key cryptosystems?
  253.  
  254.   We've talked about RSA because it's well known and easy to describe.
  255.   But there are lots of other public-key systems around, many of which
  256.   are faster than RSA or depend on problems more widely believed to be
  257.   difficult. This has been just a brief introduction; if you really want
  258.   to learn about the many facets of public-key cryptography, consult the
  259.   books and journal articles listed in part 10.
  260.  
  261. 6.11. What is the ``RSA Factoring Challenge''?
  262.  
  263.   [Note: The e-mail addresses below have been reported as invalid.]
  264.   In ~1992 the RSA Data Securities Inc., owner and licensor of multiple
  265.   patents on the RSA hardware and public key cryptographic techniques in
  266.   general, and maker of various software encryption packages and 
  267.   libraries, announced on sci.math and elsewhere the creation of an 
  268.   ongoing Factoring Challenge contest to gauge the state of the art in
  269.   factoring technology. Every month a series of numbers are posted and
  270.   monetary awards are given to the first respondent to break them into
  271.   factors. Very significant hardware resources are required to succeed 
  272.   by beating other participants. Information can be obtained via 
  273.   automated reply from
  274.  
  275.     challenge-rsa-honor-roll@rsa.com
  276.     challenge-partition-honor-roll@rsa.com
  277.  
  278.